home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update15.zoo / pml / pmlsrc / csin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-04  |  1.7 KB  |  81 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20. /*
  21.  *  FUNCTION
  22.  *
  23.  *    csin   complex double precision sine
  24.  *
  25.  *  KEY WORDS
  26.  *
  27.  *    csin
  28.  *    complex functions
  29.  *    machine independent routines
  30.  *    math libraries
  31.  *
  32.  *  DESCRIPTION
  33.  *
  34.  *    Computes double precision complex sine of a double
  35.  *    precision complex argument.
  36.  *
  37.  *  USAGE
  38.  *
  39.  *    COMPLEX csin (z)
  40.  *    COMPLEX z;
  41.  *
  42.  *  REFERENCES
  43.  *
  44.  *    Fortran 77 user's guide, Digital Equipment Corp. pp B-12
  45.  *
  46.  *  PROGRAMMER
  47.  *
  48.  *    Fred Fish
  49.  *    Tempe, Az 85281
  50.  *    (602) 966-8871
  51.  *
  52.  *  INTERNALS
  53.  *
  54.  *    Computes complex sine of z = x + j y from:
  55.  *
  56.  *        1.    r_csin = sin(x) * cosh(y)
  57.  *
  58.  *        2.    i_csin = cos(x) * sinh(y)
  59.  *
  60.  *        3.    csin(z) = r_csin + j i_csin
  61.  *
  62.  */
  63.  
  64. #if defined (__M68881__) && !defined (_M68881)
  65. /*# define _M68881*/
  66. #endif
  67.  
  68. #include <stdio.h>
  69. #include <math.h>
  70. #include "pml.h"
  71.  
  72. COMPLEX csin (z)
  73. COMPLEX z;
  74. {
  75.     COMPLEX result;
  76.  
  77.     result.real = sin (z.real) * cosh (z.imag);
  78.     result.imag = cos (z.real) * sinh (z.imag);
  79.     return (result);
  80. }
  81.